import { h } from '@logicflow/core';
import { BaseInOutModel, BaseInOutView } from '../base/BaseInOutNode';

class RepeaterModel extends BaseInOutModel {
  initNodeData(data: any): void {
    super.initNodeData(data);
    this.text.value = 'Repeater';
  }
}

class RepeaterView extends BaseInOutView {
  getIcon() {
    const { x, y } = this.props.model;
    const width = 30;
    const height = 40;
    return h('image', {
      width,
      height,
      x: x - width / 2,
      y: y - height / 2 - 5,
      href: '',
    });
  }
}

export default {
  type: 'Repeater',
  view: RepeaterView,
  model: RepeaterModel,
};
